[PHP] Using cURL to download large XML files

Posted by ndg on Stack Overflow See other posts from Stack Overflow or by ndg
Published on 2010-02-20T10:54:29Z Indexed on 2010/03/14 20:05 UTC
Read the original article Hit count: 269

Filed under:
|
|
|

I'm working with PHP and need to parse a number of fairly large XML files (50-75MB uncompressed). The issue, however, is that these XML files are stored remotely and will need to be downloaded before I can parse them.

Having thought about the issue, I think using a system() call in PHP in order to initiate a cURL transfer is probably the best way to avoid timeouts and PHP memory limits.

Has anyone done anything like this before? Specifically, what should I pass to cURL to download the remote file and ensure it's saved to a local folder of my choice?

© Stack Overflow or respective owner

Related posts about curl

Related posts about php